#!/usr/bin/env python
#    prop_soppactocd
#    ---------------
#    Molecule:         H2O
#    Wave Function:    MP2 (SOPPA)
#    Test Purpose:     Calculation of CTOCD-DZ magnetizability and
# 	             shielding constants through ABACUS

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

# Basis set 
f.add(from_string = 'Atoms and basis sets',
      num_lines = 15,
      rel_tolerance = 1.0e-2)

# Molecular geometry
f.add(from_string = 'Cartesian Coordinates',
      num_lines = 10,
      rel_tolerance = 1.0e-8)


# Symmetry
f.add(string = 'Number of coordinates in each symmetry',
      rel_tolerance = 1.0e-2)
f.add(string = 'Number of orbitals in each symmetry',
      rel_tolerance = 1.0e-2)

# Total magnetizability tensor 
f.add(from_string = 'Total magnetizability tensor',
      num_lines = 9,
      abs_tolerance = 1.0e-6)

# Diamagnetic magnetizability tensor
f.add(from_string = 'Diamagnetic magnetizability tensor',
      num_lines = 9,
      abs_tolerance = 1.0e-6)

# Paramagnetic magnetizability tensor
f.add(from_string = 'Paramagnetic magnetizability tensor',
      num_lines = 9,
      abs_tolerance = 1.0e-6)

# Total shielding tensor for 
f.add(from_string = 'Total shielding tensor',
      num_lines = 9,
      abs_tolerance = 1.0e-3)

# Diamagnetic and paramagnetic contributions
f.add(string = 'Diamagnetic contribution:',
      abs_tolerance = 1.0e-3)

test.run(['prop_soppactocd.dal'], ['H2O_intglr_sym.mol'], f={'out': f},
         accepted_errors=['not implemented for parallel calculations.'])

sys.exit(test.return_code)
